class Context:
    _registry = {}

    def __init__(self):
        pass

    @classmethod
    def register(cls, topic_type):
        print("register",cls)
        """装饰器：将实现类注册到工厂"""
        def decorator(subclass):
            # if not isinstance(subclass, type(ScoringUtils)):
            #     raise TypeError("必须继承 ScoringUtils 接口")
            cls._registry[topic_type] = subclass
            print(cls._registry)
            return subclass
        return decorator
    
    def show(self):
        print(self._registry)
        print(self._registry.keys())
        print(self._registry.values())
        print(self._registry.items())